home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.2 KB | 49 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 0724596 3-Nov-89 18:59
-
- From: ATTACHMATE Attachmate, John Bartleson,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: Re- USES problems (long)
-
- Greetings:
-
- Here are the rules for determining USES dependencies:
-
- 1. If a symbol is referenced in the implementation of a UNIT, say Unit1, and
- the symbol is defined in the interface of Unit2, then Unit1 must USE Unit2.
-
- 2. If a symbol is referenced in the interface of Unit1, and defined in Unit2,
- then Unit1, AND ALL UNITS WHICH USE Unit1, must USE Unit2. Furthermore, the
- units which USE Unit1 must USE Unit2 BEFORE they USE Unit1.
-
- Now, when I say symbols, I am refering to types, variables and
- procedures/functions. For variables and procedures/functions, one can get
- around this problem sometimes by using FORWARD statements. This basically
- tells the compiler that the is a valid symbol which will be dealt with more
- thouroughly sometime later in the compile. At the MacAppDA meeting in January
- 1989, it was proposed by TML to add FORWARD to Object declarations. Is anyone
- aware of what happened to this idea?
-
- You will often have problems with USES for interdependant Objects. Luckily,
- most of the time I can massage the problem into the case where there is an
- acyclic graph of USES dependencies. That is, take all of your Units and make
- them nodes. Draw a directed edge between each Unit and the Units it USES. If
- you have cycles, you have problems. Of course, this ruins one of the best
- aspects (in my opinion) of OOL, namely systems are composed of interacting
- objects which can be arranged arbitrarily. With Object Pascal, you must impose
- some structure on these interactions.
-
- I think that this problem with USES is the single greatest reason why I would
- avoid developing with MacApp. It is not by accident that UMacApp is one unit.
- It would be very ugly and nearly impossible to write if broken up into one unit
- per object (not that you have to, but that’s what makes sense to me).
-
- Make your UNITS carefully because someday you may have to sleep in them.
-
- John D. Rinaldo, Jr.
- Attachmate Corporation
-
-